<%--
  Created by IntelliJ IDEA.
  User: xiaoji
  Date: 2014/11/24
  Time: 14:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="session"/>
<!DOCTYPE html>

<html>
<head>
    <title>平台财务报表</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/icon.css">
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
    <script language="javascript" type="text/javascript" src="${path}/plugins/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(function(){

            $("#search_pt").click(function(){


                var currenttab =  $("#search_pt").attr("stab");
                $('#'+currenttab).datagrid('load',{
                    beginTime:$("#platformBeginTime").val(),
                    endTime:$("#platformEndTime").val(),
                    costType:$("#platformCostType").combobox("getValue")
                });
                f_findCountPlatformFinance();
            });
            f_findCountPlatformFinance();

        });


        //平台财务报表--查询统计平台财务汇总数据
        function f_findCountPlatformFinance(){
            $.post("${path}/platformFinance/findCountPlatformFinance.do",{
                beginTime:$("#platformBeginTime").val(),
                endTime:$("#platformEndTime").val(),
                costType:$("#platformCostType").combobox("getValue")
            },function(data){
                if(data.errormsg == undefined){

                    $("#ptcwSumPrice").html(data.sumPrice);

                }else{
                    alert(data.errormsg);
                }
            },"json");

        }



    </script>
</head>
<body class="easyui-layout">
<div region="center" style="padding:5px;" border="false">
    <%--<div id="tabs" class="easyui-tabs" style="width:100%;height: 650px;">--%>
        <%----%>
        <%--<div title="平台财务报表" style="padding:10px">--%>
            <table id="ttptcwbb" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:'${path}/platformFinance/findPlatformFinanceReport.do',rownumbers: true,
       method:'post',toolbar:'#ptcybb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'finish_time',align:'center',width:180">完成时间</th>
                    <th data-options="field:'user_name',align:'center',width:180">用户账号</th>
                    <th data-options="field:'price',align:'center',width:180">金额</th>
                    <th data-options="field:'type',align:'center',width:180,formatter: rowformatter2">类别</th>


                </tr>
                </thead>
            </table>
        <%--</div>--%>

    <%--</div>--%>
</div>

<!--平台财务报表 头工具项-->
<div id="ptcybb" style="padding:2px 5px;">
    开始时间: <input placeholder="请选择开始时间"  type="text" id="platformBeginTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" />
    结束时间: <input placeholder="请选择结束时间"  type="text" id="platformEndTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" />
    类别:
            <select class="easyui-combobox" data-options="editable:false" name="platformCostType" id="platformCostType" style="width:110px">
                <option value="">所有</option>
                <option value="1">作品手续费</option>
                <option value="2">项目手续费</option>
                <option value="3">竞赛活动手续费</option>
                <option value="4">项目增值服务费</option>
                <option value="5">竞赛活动增值服务费</option>
            </select>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="search_pt" stab="ttptcwbb">查找</a>
    <br/>
    <h3 style="color: #0000ff;">金额合计：<span id="ptcwSumPrice" style="color: red;">统计中...</span></h3>
</div>

<script>


    //平台财务报表---类别
    function rowformatter2(value,row,index){

       switch (value){
           case 1 :
               return "作品手续费";
           case 2 :
               return "项目手续费";
           case 3 :
               return "竞赛活动手续费";
           case 4 :
               return "项目增值服务费";
           case 5 :
               return "竞赛活动增值服务费";
           default :
               return value;
       }

    }

</script>
</body>
</html>
